Skip to content

Conversation

@Raubzeug
Copy link
Contributor

@Raubzeug Raubzeug commented Dec 1, 2025

Screen.Recording.2025-12-01.at.18.06.17.MOV
Screenshot 2025-12-01 at 18 23 14

Greptile Overview

Greptile Summary

This PR fixes two issues introduced by the rsbuild migration: CSS flash of unstyled content (FOUC) in development and Redux error serialization issues.

  • Added injectStyles: true for development builds to prevent FOUC by inlining CSS
  • Serialized error objects in getMetaCapabilities to make them Redux-compatible by extracting message and name properties from Error instances

However, the same error serialization issue still exists in getClusterCapabilities (line 18) which was not addressed in this PR.

Confidence Score: 3/5

  • Safe to merge with one logical inconsistency that should be addressed
  • The rsbuild config change is straightforward and safe. However, the error serialization fix in capabilities.ts is incomplete - only getMetaCapabilities was fixed while getClusterCapabilities has the same issue. This inconsistency could cause similar Redux warnings/errors when the cluster capabilities endpoint fails.
  • Pay attention to src/store/reducers/capabilities/capabilities.ts - the getClusterCapabilities function needs the same error serialization fix

Important Files Changed

File Analysis

Filename Score Overview
rsbuild.config.ts 5/5 Added CSS inlining for development to prevent FOUC
src/store/reducers/capabilities/capabilities.ts 3/5 Partially serialized errors for Redux compatibility; getClusterCapabilities still returns unserializable errors

Sequence Diagram

sequenceDiagram
    participant App as Application
    participant Store as Redux Store
    participant API as RTK Query API
    participant Backend as YDB Backend
    
    Note over App,Backend: Build Configuration (rsbuild.config.ts)
    App->>App: Development Mode
    App->>App: injectStyles=true (inline CSS)
    Note over App: Prevents FOUC during hot reload
    
    Note over App,Backend: Capabilities API (capabilities.ts)
    App->>Store: Request Meta Capabilities
    Store->>API: getMetaCapabilities()
    API->>Backend: window.api.meta.getMetaCapabilities()
    
    alt Success
        Backend-->>API: Capabilities Data
        API-->>Store: {data: capabilities}
        Store-->>App: Capabilities Available
    else Error (Fixed)
        Backend-->>API: Error
        API->>API: Serialize Error (message, name)
        API-->>Store: {error: {message, name}}
        Store-->>App: No Capabilities (Graceful)
    end
    
    App->>Store: Request Cluster Capabilities
    Store->>API: getClusterCapabilities()
    API->>Backend: window.api.viewer.getClusterCapabilities()
    
    alt Success
        Backend-->>API: Capabilities Data
        API-->>Store: {data: capabilities}
        Store-->>App: Capabilities Available
    else Error (Not Fixed)
        Backend-->>API: Error Object
        API-->>Store: {error: Error} ⚠️
        Note over Store: Unserializable Error<br/>May cause Redux warnings
    end
Loading

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
378 375 0 1 2
Test Changes Summary ⏭️2

⏭️ Skipped Tests (2)

  1. Scroll to row, get shareable link, navigate to URL and verify row is scrolled into view (tenant/diagnostics/tabs/queries.test.ts)
  2. Copy result button copies to clipboard (tenant/queryEditor/queryEditor.test.ts)

Bundle Size: ✅

Current: 62.32 MB | Main: 62.32 MB
Diff: +0.34 KB (0.00%)

✅ Bundle size unchanged.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

Copilot AI review requested due to automatic review settings December 1, 2025 15:23
@Raubzeug Raubzeug added the 🐞 type/bug Something isn't working label Dec 1, 2025
Copilot finished reviewing on behalf of Raubzeug December 1, 2025 15:24
@Raubzeug Raubzeug enabled auto-merge December 1, 2025 15:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes rsbuild-related issues by addressing Redux serialization warnings and FOUC (Flash of Unstyled Content) in development.

  • Serializes error objects in RTK Query to make them Redux-compatible
  • Configures rsbuild to inline CSS in development mode to prevent FOUC

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/store/reducers/capabilities/capabilities.ts Adds error serialization for getMetaCapabilities to prevent Redux non-serializable value warnings
rsbuild.config.ts Configures injectStyles to inline CSS in development mode to prevent flash of unstyled content
Comments suppressed due to low confidence (1)

src/store/reducers/capabilities/capabilities.ts:18

  • The getClusterCapabilities endpoint has the same non-serializable error issue as getMetaCapabilities. Apply the same error serialization fix here to prevent Redux warnings: const serializedError = error instanceof Error ? {message: error.message, name: error.name} : error; return {error: serializedError};
                } catch (error) {
                    // If capabilities endpoint is not available, there will be an error
                    // That means no new features are available
                    return {error};

return {error};
// Serialize the error to make it Redux-compatible
const serializedError =
error instanceof Error ? {message: error.message, name: error.name} : error;
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error serialization is incomplete. Error objects may contain additional important properties like stack and custom properties. Consider including stack for debugging: error instanceof Error ? {message: error.message, name: error.name, stack: error.stack} : error. Alternatively, use a more robust serialization utility.

Suggested change
error instanceof Error ? {message: error.message, name: error.name} : error;
error instanceof Error
? {message: error.message, name: error.name, stack: error.stack, ...error}
: error;

Copilot uses AI. Check for mistakes.
@Raubzeug Raubzeug added this pull request to the merge queue Dec 1, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments (1)

  1. src/store/reducers/capabilities/capabilities.ts, line 18 (link)

    logic: Same error serialization issue exists here - getClusterCapabilities returns raw error object which may not be Redux-compatible

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Merged via the queue into main with commit 242a3ed Dec 1, 2025
13 checks passed
@Raubzeug Raubzeug deleted the rsbuild-issues branch December 1, 2025 15:28
@Raubzeug Raubzeug self-assigned this Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants